Repository navigation
Let /gstack-ship handle very large results PRs (GST-4003) - #4847
Merged
Merged
Conversation
Raise the review_exclude_paths cap to 256 patterns within a 24,000-byte pathspec budget; keep docs/ and over-cap policies out of the too-large fix; read the secrets and banned-terms diffs through a file in whole-file parts; batch the docs-only reference grep; match exclusion patterns and named-by-code paths with a fixed number of git calls; accept bulleted Ruled note lines (GST-4003). Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Keep a file that replaces a directory of the same name matched: give the head side and the deleted side of the diff their own scratch index, and fall back to one diff per pattern when an index does not list every path. Review-Finding: p1/red-team#1 reader=red-team Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Match bracket and backslash exclude patterns with their own git diff, read index bytes for files git grep reads from the index, bound the full-context postimages the secrets scan holds, read consumer blobs in size-bounded batches, and apply the exclude byte cap only to lists over the old 64. Review-Finding: p2/adversarial-native#1 reader=adversarial-native Review-Finding: p2/outside-voice#1 reader=outside-voice Review-Finding: p2/outside-voice#2 reader=outside-voice Review-Finding: p2/outside-voice#3 reader=outside-voice Review-Finding: p2/outside-voice#4 reader=outside-voice Review-Finding: p2/specialist-batched#2 reader=specialist-batched Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
/gstack-shipnow works on results PRs with tens of thousands of files and hundreds of megabytes of diff: more exclusion patterns, a secrets check with no size limit, a faster review plan and docs check, and bulleted ruled notes.Why: two 16,000-file results PRs hit each of these limits in real runs.
Nothing to do: existing policies keep working unchanged.
What changed
review_exclude_pathstakes up to 256 patterns (was 64). A list longer than 64 must also fit its exclude pathspecs in 24,000 argument bytes together, because every reviewer's singlegit diffincludes all of them. Every list the old cap accepted still validates. An older gstack reads a longer list as invalid and reviews every file, which is safe.docs/(a results report is what the reviewer needs to read) and counts only data, log and binary bytes. When the suggested folders would push the base list past the cap or the byte budget, it prints no JSON and asks for the existing patterns to be merged instead of printing a policy gstack would refuse.gstack-banned-termsused to read the whole diff through a 256 MiB pipe. git now writes it to a private file that is read back in whole-file parts (lib/diff-parts.ts), so each parser sees exactly what it saw before. A 361.8 MB diff now reads in 4 parts in 3.9 s.git diffplus a cheap match per pattern instead of one diff per pattern. The search for code that names excluded files handsgit grepeach path's extension instead of all 16,165 paths (37 s down to 0.4 s for that grep) and finds the exact paths in each file it reads. On a real 16,165-file PR the plan went from 180 s to 100 s on 4 cores, with byte-identical output.git grep -f -instead of one grep per file: 5.6 s and one grep on the same PR.Ruled note: …line as a-or*list item. The rest of the line must still match word for word.Not in this PR
A reviewer diff that is still over 2 MB after exclusions still stops with
REVIEW_DIFF_TOO_LARGE. Splitting it into several bounded reviewer slices changes how a review pass records and checks its reviewers, so it comes in a follow-up PR.Testing
New focused tests:
test/diff-parts.test.ts,test/docs-only-batched.test.ts,test/review-exclude-match.test.ts,test/review-exclude-pattern-cap.test.tsandtest/ruled-note-bullets.test.ts. They cover a file that replaces a folder of the same name, bracket and backslash patterns (a folder literally namedres/[0-9]*), a consumer file git reads from the index (assume-unchanged), and 64 long multibyte patterns that the old cap accepted. The 64-pattern fallback tests now use 257 patterns. 336 tests in the review-exclude, docs-only, secrets, diff-parts, ship-policy and module-size suites pass locally, along withbun run typecheckandbun run typecheck:test. CI runs the full suite.Documentation
Status: updated (one factual doc correction, no blockers)
Scope: the 21 selected files from fd81a04 to b8c6f60 (committed only; nothing staged, unstaged or untracked), checked against docs/ship-policy.md, docs/troubleshooting.md, docs/review-policy.md and docs/pregate.md.
Documentation health
Coverage debt: no dedicated doc says that the pre-merge secrets check and gstack-banned-terms now read large diffs in parts, or that the docs-only reference search is now batched. Both are internal speed and robustness changes, and the changelog fragment covers them. No diagrams are affected.
Review notes
Below the blocking floor; recorded here and not fixed in this PR.
lib/review-exclude-match.ts:48: the per-pattern fallback has no test that forces it.lib/pregate/checks/secrets.ts:200: the 256 MiB full-context cutoff has no test that forces it.lib/diff-parts.ts:31: git's stderr keeps the 1 MiB default buffer, so very chatty warnings could fail the diff (it fails closed).lib/docs-only.ts:180: the batched reference read can use more memory than the old grep on very large consumer files (it fails closed).lib/ship-policy-keys.ts:59: lists of 65 to 256 patterns have no version floor, so an older gstack sets them aside and reviews every file.lib/ship-policy-keys.ts:65: the comment's command-line budget leaves out the keep literals andforbid_pathsspecs.Agent notes
GST-4003, reported from harness-evals#616 and #619. The real-PR timings come from a local clone of #616 (base 26ca0095, head 98d30986) on a 4-core cloud machine.
Approvals:
No approvals recorded for branch large-results-prs-ship-scaling.
Plan: exempt: bug fix, no plan review needed
REVIEW_LOOP: passes=3 blocking_found=6 deferred=0 noted=7 fixed=7 scope=frozen ledgers_read=4 dispatches=12